<extend name="./Common/View/Public/form.html" />
<block name="page_title">添加项目</block>
<block name="main">
        <form class="layui-form" method="post" action="rate/project/insert" lay-filter="pageForm">
            <div class="layui-form-item">
                <label class="layui-form-label">使用模板</label>
                <div class="layui-input-block">
                    <select name="tpl_id" id="tpl_id" lay-filter="tpl_id" lay-verify="required" api="rate/template/slist" empty="请选择模板">
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">项目名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="title" maxlength="50" minlength="1" required lay-verify="required|length" placeholder="请输入项目名称" autocomplete="off" class="layui-input" />
                </div>
                <div class="layui-form-mid layui-word-aux">1-6个英文或汉字</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">开始时间</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" laydate name="start_time" id="start_time" placeholder="{:date('Y-m-d')}">
                </div>
                <div class="layui-form-mid layui-word-aux">项目的开始时间，之前用户看不到该项目</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">结束时间</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" laydate name="end_time" id="end_time">
                </div>
                <div class="layui-form-mid layui-word-aux">项目的结束时间，之后参评用户不能打分</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">项目状态</label>
                <div class="layui-input-block">
                    {:W('Todo/Dict/radio',array('STATUS','status',2))}
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">诸去高去低</label>
                <div class="layui-input-block">
                    {:W('Todo/Dict/radio',array('BOOLEAN','high_lower',1))}
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否匿名</label>
                <div class="layui-input-block">
                    {:W('Todo/Dict/radio',array('BOOLEAN','is_anonymous',1))}
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">开放查询</label>
                <div class="layui-input-block">
                    {:W('Todo/Dict/radio',array('BOOLEAN','can_query',1))}
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">项目说明</label>
                <div class="layui-input-block">
                    <textarea name="remark" placeholder="项目说明" class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="pageForm">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </block>


<block name="script">
    <script>
        layui.use('laydate', function() {
            var laydate = layui.laydate;

            laydate.render({
                elem: '#start_time'
                ,type: 'datetime'
            });
            laydate.render({
                elem: '#end_time'
                ,type: 'datetime'
            });
        });
    </script>
</block>